<template>
  <el-select v-model="dateModel" style="width: 120px;" clearable size="mini" filterable :placeholder="placeholder"
    @change="dateChange()">
    <el-option v-for="i in dict" :key="i.value" :label="i.label" :value="i.value">
    </el-option>
  </el-select>
</template>

<script>
export default {
  name: 'SDictSelect',
  props: {
    name: "",

  },
  data() {
    return {
      dateModel: "",
      placeholder: ""
    }
  },
  methods: {
    dateChange: function () {
      this.$emit('input', this.dateModel)


    }
  },
  created() {
    var d = this.$store.state.dict;
    this.placeholder = d.dictName[this.name]
    this.dict = d.dicts[this.name];
  }
}
</script>
 